package com.tencentcloudapi.apitest;

import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;

import com.tencentcloudapi.vod.v20180717.VodClient;
import com.tencentcloudapi.vod.v20180717.models.*;

/* ━━━━━━佛祖保佑━━━━━━
 *                  ,;,,;
 *                ,;;'(    社
 *      __      ,;;' ' \   会
 *   /'  '\'~~'~' \ /'\.)  主
 * ,;(      )    /  |.     义
 *,;' \    /-.,,(   ) \    码
 *     ) /       ) / )|    农
 *     ||        ||  \)
 *     (_\       (_\
 * ━━━━━━永无BUG━━━━━━
 * @author ：zjq
 * @date ：2021/3/28 1:50
 *        参考文档        https://cloud.tencent.com/document/product/266/31813
 * @description: TODO   腾讯云点播  api
 *                      SecretId：            AKIDVt21kE9tMgTX3IQ5dfqreDtQmusHQdah
 *                      SecretKey：           h8LIzUkkZBYgaFhsoeHemeGgsoUv67sO
 * @version: V1.0
 * @slogan: 天下风云出我辈，一入代码岁月催
 */
public class VODApiTest {


    private static String SecretId = "AKIDVt21kE9tMgTX3IQ5dfqreDtQmusHQdah";
    private static String SecretKey = "h8LIzUkkZBYgaFhsoeHemeGgsoUv67sO";


    public static void main(String[] args) {

        String[] fileIds1 = {"5285890816016512223", "5285890815994789810"};
        DescribeMediaInfos(fileIds1);

    }


    /**
     * 获取媒体详细信息
     * https://console.cloud.tencent.com/api/explorer?Product=vod&Version=2018-07-17&Action=DescribeMediaInfos&SignVersion=
     *
     * @param fileIds1 云点播 ---> 媒体管理 ---> 视频id
     */
    public static void DescribeMediaInfos(String[] fileIds1) {
        try {

            Credential cred = new Credential(SecretId, SecretKey);

            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint("vod.tencentcloudapi.com");

            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);

            VodClient client = new VodClient(cred, "", clientProfile);

            DescribeMediaInfosRequest req = new DescribeMediaInfosRequest();
//            String[] fileIds1 = {"5285890816016512223", "5285890815994789810"};
            req.setFileIds(fileIds1);


            DescribeMediaInfosResponse resp = client.DescribeMediaInfos(req);

            System.out.println(DescribeMediaInfosResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            System.out.println(e.toString());
        }

    }

}



